home *** CD-ROM | disk | FTP | other *** search
/ The 640 MEG Shareware Studio 2 / The 640 Meg Shareware Studio CD-ROM Volume II (Data Express)(1993).ISO / pascal / makescrn.zip / MAKESCRN.DOC next >
Text File  |  1989-08-27  |  6KB  |  110 lines

  1.  
  2. MakeScrn - a text screen painting utility
  3. Written by Steve Sneed
  4. Released to the Public Domain   27-Aug-89
  5. -----------------------------------------
  6.  
  7. REQUIRES: Turbo Pascal 5.x and the TurboPower Professional 5.0x libraries
  8.  
  9. --------
  10.  
  11. Ever wish you could quickly "paint" a text screen the way you can a graphics
  12. screen?  And then save it in the TurboPower Professional "Packed Window"
  13. format for later use in a program?
  14.  
  15. I came on board in a new job recently, as was handed a TP project that used
  16. over 50 different screens.  Another programmer that was leaving the company
  17. had done about 15% of the screens already, and had done them the hard way -
  18. coding the actual TP and TPro screen manipulation procedures/functions to
  19. draw the screen in the program and then save the screen to packed format.
  20. She had taken at least a day per screen; juggling prompt positions, trying
  21. attributes, starting over when she decided it wasn't what she wanted or when
  22. one of the other programmers made a change to data formats or other info to
  23. be displayed on the screen, etc.  I know there had to be a better way... here
  24. it is.
  25.  
  26. MakeScrn is a simple little program provided in source format that allows you
  27. to draw frames, enter text, change attributes, move portions of the screen
  28. around and generally "paint" what you want using similar commands to what you
  29. will find in many graphics paint programs.  Screens you create in the program
  30. can be saved to disk as a "packed screen" using the routines in the TurboPower
  31. Professional 5.0x libraries, and can be reloaded for further work.
  32.  
  33. Certainly there are other features that could be added to the program, and
  34. "gee-whiz" changes that could be made to the existing routines (I'd like to
  35. add the ability to rubberband frames, for example.)  I leave these for you
  36. to experiment with, for I hope this can be a learning tool as well as a
  37. functional program (that's why I provide it in source form only!)
  38.  
  39. --------
  40.  
  41. Here's a basic outline of the program:
  42.  
  43. When you execute the program, you are presented with a blank screen and the
  44. menu of commands in the upper right-hand corner.  Pressing the first char of
  45. the command name executes that command.  The available commands are:
  46.  
  47. C)hange attributes - Change the display attributes (foreground and background
  48.                      colors) for an area.  You select the area to change by
  49.                      first "dropping anchor" in the upper-left corner of the
  50.                      area by moving the cursor to that spot and pressing
  51.                      [Enter] or [LeftButton], then use the cursor keys or
  52.                      mouse to move to the lower-right corner and press [Enter]
  53.                      or [LeftButton] to define the area.  The area can be any
  54.                      region from a single character cell to the entire screen.
  55.                      Once the area is defined, a map of screen attributes is
  56.                      displayed; the hex numbers going down the side of the map
  57.                      are the background values, the hex numbers across the top
  58.                      are the foreground attributes.  Enter a 2-digit hex value
  59.                      for the new attribute (background value first) at the
  60.                      prompt in the lower left corner of the screen and the
  61.                      area will change to that value.  At any time during the
  62.                      process, you can press [Esc] or [RightButton] to abort
  63.                      the whole process.
  64.  
  65. D)raw Frame        - Makes it easy to frame a window.  Just like the C)hange
  66.                      attribute command, you drop anchor at the upper left
  67.                      corner and then drop anchor again at the lower right
  68.                      corner; the frame will be drawn.
  69.  
  70. E)rase Area        - Erases all text characters from the area defined by
  71.                      dropping anchors.  The underlying attributes are not
  72.                      changed.
  73.  
  74. F)rame Chars       - Allows you to change between the four common frame char
  75.                      sets.
  76.  
  77. I)nput Text        - Allows you to input text on the screen.  The only editing
  78.                      command available is the backspace.  Drop anchor where
  79.                      you want the text to start, and type.  Press [Esc] or
  80.                      [RightButton] when complete.
  81.  
  82. L)oad Screen       - Loads an existing screen from a file.  You are prompted
  83.                      for the name of the file.  Note that you can automatically
  84.                      load a screen when you execute the program by providing
  85.                      its name on the command line.
  86.  
  87. M)ove Area         - Allows movement of a region of the screen from one X-Y
  88.                      location to another.  Define the area by dropping anchors,
  89.                      then place the cursor at the upper left corner of the
  90.                      new location for the region and press [Enter] of [Left-
  91.                      Button] to move.  The area is forced to within the cur-
  92.                      rent screen boundries.
  93.  
  94. Q)uit              - As its name implies, this exits the program.  The current
  95.                      screen contents are NOT saved; be sure to use the S)ave
  96.                      Screen command if you need to do so.
  97.  
  98. V)iew              - Just hides the menu so you can see the entire screen.
  99.                      Pressing [Enter], [Esc], [LeftButton] or [RightButton]
  100.                      restores the menu.
  101.  
  102. S)ave Screen       - Saves the current screen to a file.  You are prompted for
  103.                      the filename to save.  This file will be in the Turbo
  104.                      Power "packed window" format for easy use in another
  105.                      program.  NOTE: I recommend that you give the screen file
  106.                      a name that will make it easy to later incluude in a
  107.                      "packed screen library" using the other routines in the
  108.                      TpCrt unit.
  109.  
  110.